package club.lovety.service.roution.zuul.circuit;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
public class StoreIntegration {

    private static final Logger log = LoggerFactory.getLogger(StoreIntegration.class);

    @HystrixCommand(fallbackMethod = "defaultStores")
    public Object getStores(Map<String, Object> parameters) {
        //do stuff that might fail
        return  null;
    }
    public Object defaultStores(Map<String, Object> parameters) {
        log.info("执行了熔断，参数: {}",parameters);
        return "zuul熔断";
    }
}
